﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ppt = Microsoft.Office.Interop.PowerPoint;

namespace ObjectModel.PowerPoint
{
    public class PresentationLinkedDictionary<TValue> : Dictionary<Ppt.Presentation, TValue>
    {
        readonly Ppt.Application mApp = Globals.Application;

        public PresentationLinkedDictionary()
        {
            mApp.PresentationClose += App_PresentationClose;
        }

        void App_PresentationClose(Ppt.Presentation Pres)
        {
            if (ContainsKey(Pres))
                Remove(Pres);
        }
    }
}
